{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 基金研究\n",
    "\n",
    "- 作者：DGC'Idea\n",
    "- 版本：V0.1   \n",
    "- 更新日期：2018年3月14日"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "数据引擎：运行于研究\n",
      "基金框架：运行于研究\n"
     ]
    }
   ],
   "source": [
    "#导入库\n",
    "import numpy as np\n",
    "import pandas as pd\n",
    "\n",
    "#引入自定义库\n",
    "import sys\n",
    "sys.path.append('/home/jquser')\n",
    "from pf_fnd import Fund\n",
    "\n",
    "fund=Fund('csv','../Data/','index')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 1.基本信息\n",
    "- 查看基金代码、名称、简称、成立日期等信息；"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>名称</th>\n",
       "      <th>type</th>\n",
       "      <th>start_date</th>\n",
       "      <th>index_code</th>\n",
       "      <th>index_name</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>510360.SH</th>\n",
       "      <td>广发300</td>\n",
       "      <td>etf</td>\n",
       "      <td>2015-09-09</td>\n",
       "      <td>000300.SH</td>\n",
       "      <td>沪深300</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>512300.SH</th>\n",
       "      <td>500医药</td>\n",
       "      <td>etf</td>\n",
       "      <td>2015-06-04</td>\n",
       "      <td>000857.SH</td>\n",
       "      <td>500医药</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>510170.SH</th>\n",
       "      <td>商品ETF</td>\n",
       "      <td>etf</td>\n",
       "      <td>2011-01-25</td>\n",
       "      <td>000066.SH</td>\n",
       "      <td>上证商品</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159952.SZ</th>\n",
       "      <td>创业ETF</td>\n",
       "      <td>etf</td>\n",
       "      <td>2017-05-19</td>\n",
       "      <td>399006.SZ</td>\n",
       "      <td>创业板指</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>510300.SH</th>\n",
       "      <td>300ETF</td>\n",
       "      <td>etf</td>\n",
       "      <td>2012-05-28</td>\n",
       "      <td>000300.SH</td>\n",
       "      <td>沪深300</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>510130.SH</th>\n",
       "      <td>中盘ETF</td>\n",
       "      <td>etf</td>\n",
       "      <td>2010-06-23</td>\n",
       "      <td>000044.SH</td>\n",
       "      <td>上证中盘</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>510580.SH</th>\n",
       "      <td>ZZ500ETF</td>\n",
       "      <td>etf</td>\n",
       "      <td>2015-09-14</td>\n",
       "      <td>000905.SH</td>\n",
       "      <td>中证500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159929.SZ</th>\n",
       "      <td>医药ETF</td>\n",
       "      <td>etf</td>\n",
       "      <td>2013-09-16</td>\n",
       "      <td>399933.SZ</td>\n",
       "      <td>中证医药卫生指数</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>512900.SH</th>\n",
       "      <td>证券基金</td>\n",
       "      <td>etf</td>\n",
       "      <td>2017-03-31</td>\n",
       "      <td>399975.SZ</td>\n",
       "      <td>中证全指证券公司指数(四级行业)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>160635.SZ</th>\n",
       "      <td>医药基金</td>\n",
       "      <td>lof</td>\n",
       "      <td>2016-08-01</td>\n",
       "      <td>399933.SZ</td>\n",
       "      <td>中证医药卫生指数</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>162510.SZ</th>\n",
       "      <td>国安双力</td>\n",
       "      <td>lof</td>\n",
       "      <td>2015-05-20</td>\n",
       "      <td>399101.SZ</td>\n",
       "      <td>中小板综</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159940.SZ</th>\n",
       "      <td>全指金融</td>\n",
       "      <td>etf</td>\n",
       "      <td>2015-04-17</td>\n",
       "      <td>000992.SH</td>\n",
       "      <td>全指金融</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>512680.SH</th>\n",
       "      <td>军工基金</td>\n",
       "      <td>etf</td>\n",
       "      <td>2016-10-14</td>\n",
       "      <td>399967.SZ</td>\n",
       "      <td>中证军工</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>510430.SH</th>\n",
       "      <td>50等权</td>\n",
       "      <td>etf</td>\n",
       "      <td>2012-09-24</td>\n",
       "      <td>000050.SH</td>\n",
       "      <td>50等权</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>510190.SH</th>\n",
       "      <td>龙头ETF</td>\n",
       "      <td>etf</td>\n",
       "      <td>2011-01-10</td>\n",
       "      <td>000065.SH</td>\n",
       "      <td>上证龙头</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159936.SZ</th>\n",
       "      <td>可选消费</td>\n",
       "      <td>etf</td>\n",
       "      <td>2014-06-25</td>\n",
       "      <td>000989.SH</td>\n",
       "      <td>全指可选</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>160706.SZ</th>\n",
       "      <td>嘉实300</td>\n",
       "      <td>lof</td>\n",
       "      <td>2005-10-17</td>\n",
       "      <td>000300.SH</td>\n",
       "      <td>沪深300</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>167901.SZ</th>\n",
       "      <td>华宸300</td>\n",
       "      <td>lof</td>\n",
       "      <td>2013-06-03</td>\n",
       "      <td>000300.SH</td>\n",
       "      <td>沪深300</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159924.SZ</th>\n",
       "      <td>300等权</td>\n",
       "      <td>etf</td>\n",
       "      <td>2013-06-05</td>\n",
       "      <td>000984.SH</td>\n",
       "      <td>300等权</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>510150.SH</th>\n",
       "      <td>消费ETF</td>\n",
       "      <td>etf</td>\n",
       "      <td>2011-02-25</td>\n",
       "      <td>000069.SH</td>\n",
       "      <td>消费80</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159930.SZ</th>\n",
       "      <td>能源ETF</td>\n",
       "      <td>etf</td>\n",
       "      <td>2013-09-16</td>\n",
       "      <td>399928.SZ</td>\n",
       "      <td>中证能源指数</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>166007.SZ</th>\n",
       "      <td>中欧300</td>\n",
       "      <td>lof</td>\n",
       "      <td>2010-08-16</td>\n",
       "      <td>000300.SH</td>\n",
       "      <td>沪深300</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>510630.SH</th>\n",
       "      <td>消费行业</td>\n",
       "      <td>etf</td>\n",
       "      <td>2013-05-08</td>\n",
       "      <td>000036.SH</td>\n",
       "      <td>上证消费</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159919.SZ</th>\n",
       "      <td>300ETF</td>\n",
       "      <td>etf</td>\n",
       "      <td>2012-05-28</td>\n",
       "      <td>000300.SH</td>\n",
       "      <td>沪深300</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>510050.SH</th>\n",
       "      <td>50ETF</td>\n",
       "      <td>etf</td>\n",
       "      <td>2005-02-23</td>\n",
       "      <td>000016.SH</td>\n",
       "      <td>上证50</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>512400.SH</th>\n",
       "      <td>有色金属</td>\n",
       "      <td>lof</td>\n",
       "      <td>2017-09-01</td>\n",
       "      <td>000819.SH</td>\n",
       "      <td>有色金属</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>510270.SH</th>\n",
       "      <td>国企ETF</td>\n",
       "      <td>etf</td>\n",
       "      <td>2011-08-18</td>\n",
       "      <td>000056.SH</td>\n",
       "      <td>上证国企</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>510880.SH</th>\n",
       "      <td>红利ETF</td>\n",
       "      <td>etf</td>\n",
       "      <td>2007-01-18</td>\n",
       "      <td>000015.SH</td>\n",
       "      <td>红利指数</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>161630.SZ</th>\n",
       "      <td>融通农业</td>\n",
       "      <td>lof</td>\n",
       "      <td>2017-02-15</td>\n",
       "      <td>399814.SZ</td>\n",
       "      <td>中证大农业指数</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>512070.SH</th>\n",
       "      <td>非银ETF</td>\n",
       "      <td>etf</td>\n",
       "      <td>2014-07-18</td>\n",
       "      <td>000849.SH</td>\n",
       "      <td>沪深300非银行金融指数</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>161217.SZ</th>\n",
       "      <td>国投资源</td>\n",
       "      <td>lof</td>\n",
       "      <td>2011-08-29</td>\n",
       "      <td>399961.SZ</td>\n",
       "      <td>中证上游资源产业指数</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>161213.SZ</th>\n",
       "      <td>国投消费</td>\n",
       "      <td>lof</td>\n",
       "      <td>2011-01-20</td>\n",
       "      <td>399963.SZ</td>\n",
       "      <td>中证下游消费与服务产业指数</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>160807.SZ</th>\n",
       "      <td>长盛300</td>\n",
       "      <td>lof</td>\n",
       "      <td>2010-09-06</td>\n",
       "      <td>000300.SH</td>\n",
       "      <td>沪深300</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159953.SZ</th>\n",
       "      <td>工业ETF</td>\n",
       "      <td>etf</td>\n",
       "      <td>2017-07-14</td>\n",
       "      <td>000988.SH</td>\n",
       "      <td>全指工业</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>512500.SH</th>\n",
       "      <td>中证500</td>\n",
       "      <td>etf</td>\n",
       "      <td>2015-06-04</td>\n",
       "      <td>000905.SH</td>\n",
       "      <td>中证500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159928.SZ</th>\n",
       "      <td>消费ETF</td>\n",
       "      <td>etf</td>\n",
       "      <td>2013-09-16</td>\n",
       "      <td>399932.SZ</td>\n",
       "      <td>中证主要消费指数</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>512980.SH</th>\n",
       "      <td>传媒ETF</td>\n",
       "      <td>etf</td>\n",
       "      <td>2018-01-19</td>\n",
       "      <td>399971.SZ</td>\n",
       "      <td>中证传媒指数</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>165309.SZ</th>\n",
       "      <td>建信300</td>\n",
       "      <td>lof</td>\n",
       "      <td>2009-11-30</td>\n",
       "      <td>000300.SH</td>\n",
       "      <td>沪深300</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>512610.SH</th>\n",
       "      <td>医药卫生</td>\n",
       "      <td>etf</td>\n",
       "      <td>2014-07-25</td>\n",
       "      <td>000933.SH</td>\n",
       "      <td>中证医药</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159943.SZ</th>\n",
       "      <td>深证ETF</td>\n",
       "      <td>etf</td>\n",
       "      <td>2015-07-08</td>\n",
       "      <td>399001.SZ</td>\n",
       "      <td>深证成指</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>510110.SH</th>\n",
       "      <td>周期ETF</td>\n",
       "      <td>etf</td>\n",
       "      <td>2010-11-15</td>\n",
       "      <td>000063.SH</td>\n",
       "      <td>上证周期</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>512810.SH</th>\n",
       "      <td>军工行业</td>\n",
       "      <td>etf</td>\n",
       "      <td>2016-08-22</td>\n",
       "      <td>399967.SZ</td>\n",
       "      <td>中证军工</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>161907.SZ</th>\n",
       "      <td>万家红利</td>\n",
       "      <td>lof</td>\n",
       "      <td>2011-06-15</td>\n",
       "      <td>000922.SH</td>\n",
       "      <td>中证红利</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>510650.SH</th>\n",
       "      <td>金融行业</td>\n",
       "      <td>etf</td>\n",
       "      <td>2013-05-08</td>\n",
       "      <td>000038.SH</td>\n",
       "      <td>上证金融</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>512340.SH</th>\n",
       "      <td>500原料</td>\n",
       "      <td>etf</td>\n",
       "      <td>2015-06-04</td>\n",
       "      <td>000854.SH</td>\n",
       "      <td>500原料</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>510280.SH</th>\n",
       "      <td>成长ETF</td>\n",
       "      <td>etf</td>\n",
       "      <td>2011-10-18</td>\n",
       "      <td>000028.SH</td>\n",
       "      <td>180成长</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159945.SZ</th>\n",
       "      <td>全指能源</td>\n",
       "      <td>etf</td>\n",
       "      <td>2015-07-06</td>\n",
       "      <td>000986.SH</td>\n",
       "      <td>全指能源</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159942.SZ</th>\n",
       "      <td>中创100</td>\n",
       "      <td>etf</td>\n",
       "      <td>2015-06-25</td>\n",
       "      <td>399612.SZ</td>\n",
       "      <td>中创100</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>512100.SH</th>\n",
       "      <td>1000ETF</td>\n",
       "      <td>etf</td>\n",
       "      <td>2016-11-04</td>\n",
       "      <td>000852.SH</td>\n",
       "      <td>中证1000指数</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159908.SZ</th>\n",
       "      <td>深F200</td>\n",
       "      <td>etf</td>\n",
       "      <td>2011-07-13</td>\n",
       "      <td>399703.SZ</td>\n",
       "      <td>深证F200</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>510070.SH</th>\n",
       "      <td>民企ETF</td>\n",
       "      <td>etf</td>\n",
       "      <td>2010-10-29</td>\n",
       "      <td>000049.SH</td>\n",
       "      <td>上证民企</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>510380.SH</th>\n",
       "      <td>国寿300</td>\n",
       "      <td>lof</td>\n",
       "      <td>2018-02-07</td>\n",
       "      <td>000300.SH</td>\n",
       "      <td>沪深300</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>162711.SZ</th>\n",
       "      <td>广发500L</td>\n",
       "      <td>lof</td>\n",
       "      <td>2010-01-08</td>\n",
       "      <td>399905.SZ</td>\n",
       "      <td>中证500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>510520.SH</th>\n",
       "      <td>诺安500</td>\n",
       "      <td>etf</td>\n",
       "      <td>2014-03-10</td>\n",
       "      <td>000905.SH</td>\n",
       "      <td>中证500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159939.SZ</th>\n",
       "      <td>信息技术</td>\n",
       "      <td>etf</td>\n",
       "      <td>2015-02-05</td>\n",
       "      <td>000993.SH</td>\n",
       "      <td>全指信息</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>510660.SH</th>\n",
       "      <td>医药行业</td>\n",
       "      <td>etf</td>\n",
       "      <td>2013-05-08</td>\n",
       "      <td>000037.SH</td>\n",
       "      <td>上证医药</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159903.SZ</th>\n",
       "      <td>深成ETF</td>\n",
       "      <td>etf</td>\n",
       "      <td>2010-02-02</td>\n",
       "      <td>399001.SZ</td>\n",
       "      <td>深证成指</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159931.SZ</th>\n",
       "      <td>金融ETF</td>\n",
       "      <td>etf</td>\n",
       "      <td>2013-09-16</td>\n",
       "      <td>399934.SZ</td>\n",
       "      <td>中证金融地产指数</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159955.SZ</th>\n",
       "      <td>创业板E</td>\n",
       "      <td>etf</td>\n",
       "      <td>2017-08-23</td>\n",
       "      <td>399006.SZ</td>\n",
       "      <td>创业板指</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>510220.SH</th>\n",
       "      <td>中小ETF</td>\n",
       "      <td>etf</td>\n",
       "      <td>2011-03-28</td>\n",
       "      <td>000046.SH</td>\n",
       "      <td>上证中小</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>147 rows × 5 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                 名称 type start_date  index_code        index_name\n",
       "510360.SH     广发300  etf  2015-09-09  000300.SH             沪深300\n",
       "512300.SH     500医药  etf  2015-06-04  000857.SH             500医药\n",
       "510170.SH     商品ETF  etf  2011-01-25  000066.SH              上证商品\n",
       "159952.SZ     创业ETF  etf  2017-05-19  399006.SZ              创业板指\n",
       "510300.SH    300ETF  etf  2012-05-28  000300.SH             沪深300\n",
       "510130.SH     中盘ETF  etf  2010-06-23  000044.SH              上证中盘\n",
       "510580.SH  ZZ500ETF  etf  2015-09-14  000905.SH             中证500\n",
       "159929.SZ     医药ETF  etf  2013-09-16  399933.SZ          中证医药卫生指数\n",
       "512900.SH      证券基金  etf  2017-03-31  399975.SZ  中证全指证券公司指数(四级行业)\n",
       "160635.SZ      医药基金  lof  2016-08-01  399933.SZ          中证医药卫生指数\n",
       "162510.SZ      国安双力  lof  2015-05-20  399101.SZ              中小板综\n",
       "159940.SZ      全指金融  etf  2015-04-17  000992.SH              全指金融\n",
       "512680.SH      军工基金  etf  2016-10-14  399967.SZ              中证军工\n",
       "510430.SH      50等权  etf  2012-09-24  000050.SH              50等权\n",
       "510190.SH     龙头ETF  etf  2011-01-10  000065.SH              上证龙头\n",
       "159936.SZ      可选消费  etf  2014-06-25  000989.SH              全指可选\n",
       "160706.SZ     嘉实300  lof  2005-10-17  000300.SH             沪深300\n",
       "167901.SZ     华宸300  lof  2013-06-03  000300.SH             沪深300\n",
       "159924.SZ     300等权  etf  2013-06-05  000984.SH             300等权\n",
       "510150.SH     消费ETF  etf  2011-02-25  000069.SH              消费80\n",
       "159930.SZ     能源ETF  etf  2013-09-16  399928.SZ            中证能源指数\n",
       "166007.SZ     中欧300  lof  2010-08-16  000300.SH             沪深300\n",
       "510630.SH      消费行业  etf  2013-05-08  000036.SH              上证消费\n",
       "159919.SZ    300ETF  etf  2012-05-28  000300.SH             沪深300\n",
       "510050.SH     50ETF  etf  2005-02-23  000016.SH              上证50\n",
       "512400.SH      有色金属  lof  2017-09-01  000819.SH              有色金属\n",
       "510270.SH     国企ETF  etf  2011-08-18  000056.SH              上证国企\n",
       "510880.SH     红利ETF  etf  2007-01-18  000015.SH              红利指数\n",
       "161630.SZ      融通农业  lof  2017-02-15  399814.SZ           中证大农业指数\n",
       "512070.SH     非银ETF  etf  2014-07-18  000849.SH      沪深300非银行金融指数\n",
       "...             ...  ...         ...        ...               ...\n",
       "161217.SZ      国投资源  lof  2011-08-29  399961.SZ        中证上游资源产业指数\n",
       "161213.SZ      国投消费  lof  2011-01-20  399963.SZ     中证下游消费与服务产业指数\n",
       "160807.SZ     长盛300  lof  2010-09-06  000300.SH             沪深300\n",
       "159953.SZ     工业ETF  etf  2017-07-14  000988.SH              全指工业\n",
       "512500.SH     中证500  etf  2015-06-04  000905.SH             中证500\n",
       "159928.SZ     消费ETF  etf  2013-09-16  399932.SZ          中证主要消费指数\n",
       "512980.SH     传媒ETF  etf  2018-01-19  399971.SZ            中证传媒指数\n",
       "165309.SZ     建信300  lof  2009-11-30  000300.SH             沪深300\n",
       "512610.SH      医药卫生  etf  2014-07-25  000933.SH              中证医药\n",
       "159943.SZ     深证ETF  etf  2015-07-08  399001.SZ              深证成指\n",
       "510110.SH     周期ETF  etf  2010-11-15  000063.SH              上证周期\n",
       "512810.SH      军工行业  etf  2016-08-22  399967.SZ              中证军工\n",
       "161907.SZ      万家红利  lof  2011-06-15  000922.SH              中证红利\n",
       "510650.SH      金融行业  etf  2013-05-08  000038.SH              上证金融\n",
       "512340.SH     500原料  etf  2015-06-04  000854.SH             500原料\n",
       "510280.SH     成长ETF  etf  2011-10-18  000028.SH             180成长\n",
       "159945.SZ      全指能源  etf  2015-07-06  000986.SH              全指能源\n",
       "159942.SZ     中创100  etf  2015-06-25  399612.SZ             中创100\n",
       "512100.SH   1000ETF  etf  2016-11-04  000852.SH          中证1000指数\n",
       "159908.SZ     深F200  etf  2011-07-13  399703.SZ            深证F200\n",
       "510070.SH     民企ETF  etf  2010-10-29  000049.SH              上证民企\n",
       "510380.SH     国寿300  lof  2018-02-07  000300.SH             沪深300\n",
       "162711.SZ    广发500L  lof  2010-01-08  399905.SZ             中证500\n",
       "510520.SH     诺安500  etf  2014-03-10  000905.SH             中证500\n",
       "159939.SZ      信息技术  etf  2015-02-05  000993.SH              全指信息\n",
       "510660.SH      医药行业  etf  2013-05-08  000037.SH              上证医药\n",
       "159903.SZ     深成ETF  etf  2010-02-02  399001.SZ              深证成指\n",
       "159931.SZ     金融ETF  etf  2013-09-16  399934.SZ          中证金融地产指数\n",
       "159955.SZ      创业板E  etf  2017-08-23  399006.SZ              创业板指\n",
       "510220.SH     中小ETF  etf  2011-03-28  000046.SH              上证中小\n",
       "\n",
       "[147 rows x 5 columns]"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "fund.pool.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 2.阶段涨幅\n",
    "- 查看1日、5日、10日、20日、年初至今涨幅。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "scrolled": true
   },
   "outputs": [],
   "source": [
    "#指数涨幅分析\n",
    "def fund_market_analysis(fund_list,data_root='./'):\n",
    "    market_results=[]\n",
    "    start_date=min_date#pd.datetime.today().strftime('%Y')+'-01-01'\n",
    "    end_date=pd.datetime.today()-timedelta(1)\n",
    "    #行业类别代码    \n",
    "    for code in fund_list:\n",
    "        #指数名称\n",
    "        fund_name=fund_all_list[code] \n",
    "        #显示进度\n",
    "        print ('行情统计:', fund_name,end='\\r')\n",
    "        #获取数据\n",
    "        df=get_price(code,start_date=start_date,end_date=end_date,frequency='daily', \n",
    "                      fields=['open','close','low','high','volume','money','pre_close']) \n",
    "        \n",
    "        if len(df)==0 :\n",
    "            continue\n",
    "        #1日涨幅\n",
    "        rise_1d=(df['close'].iloc[-1]-df['pre_close'].iloc[-1])/df['pre_close'].iloc[-1]*100.0\n",
    "        #5日涨幅\n",
    "        rise_5d=(df['close'].iloc[-1]-df['pre_close'].iloc[-5])/df['pre_close'].iloc[-5]*100.0\n",
    "        #10日涨幅\n",
    "        rise_10d=(df['close'].iloc[-1]-df['pre_close'].iloc[-10])/df['pre_close'].iloc[-10]*100.0\n",
    "        #20日涨幅\n",
    "        rise_20d=(df['close'].iloc[-1]-df['pre_close'].iloc[-20])/df['pre_close'].iloc[-20]*100.0\n",
    "        #年初至今涨幅\n",
    "        rise_Early=(df['close'].iloc[-1]-df['pre_close'].iloc[0])/df['pre_close'].iloc[0]*100.0\n",
    "        #30日涨幅\n",
    "        rise_30d=(df['close'].iloc[-1]-df['pre_close'].iloc[-30])/df['pre_close'].iloc[-30]*100.0\n",
    "        #90日涨幅\n",
    "        rise_90d=(df['close'].iloc[-1]-df['pre_close'].iloc[-90])/df['pre_close'].iloc[-90]*100.0\n",
    "        #250日涨幅\n",
    "        rise_250d=(df['close'].iloc[-1]-df['pre_close'].iloc[-250])/df['pre_close'].iloc[-250]*100.0\n",
    "        market_results.append([fund_name,\n",
    "                               round(rise_1d,3),round(rise_5d,3),round(rise_10d,3),round(rise_20d,3),\n",
    "                               round(rise_Early,3), \n",
    "                               round(rise_30d,3), round(rise_90d,3), round(rise_250d,3), \n",
    "                           ])  \n",
    "        \n",
    "    market_columns=['指数','1日','5日','10日','20日','年初至今','30日','90日','250日']\n",
    "    df=pd.DataFrame(data=market_results,index=fund_list.keys(),columns=market_columns)  \n",
    "    #去除代码后缀\n",
    "    df.index=df.index.astype('str').str[0:6] \n",
    "    #按照涨幅排序\n",
    "    return df"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 2.1.昨日涨幅前10"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "昨日涨幅：\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>指数</th>\n",
       "      <th>1日</th>\n",
       "      <th>5日</th>\n",
       "      <th>10日</th>\n",
       "      <th>20日</th>\n",
       "      <th>年初至今</th>\n",
       "      <th>30日</th>\n",
       "      <th>90日</th>\n",
       "      <th>250日</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>512010</th>\n",
       "      <td>医药ETF</td>\n",
       "      <td>2.733</td>\n",
       "      <td>2.792</td>\n",
       "      <td>9.400</td>\n",
       "      <td>14.105</td>\n",
       "      <td>NaN</td>\n",
       "      <td>7.381</td>\n",
       "      <td>9.400</td>\n",
       "      <td>35.629</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>512070</th>\n",
       "      <td>非银ETF</td>\n",
       "      <td>2.321</td>\n",
       "      <td>-0.197</td>\n",
       "      <td>4.107</td>\n",
       "      <td>7.758</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-7.058</td>\n",
       "      <td>-2.265</td>\n",
       "      <td>20.642</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>510660</th>\n",
       "      <td>医药行业</td>\n",
       "      <td>2.113</td>\n",
       "      <td>0.763</td>\n",
       "      <td>7.430</td>\n",
       "      <td>13.006</td>\n",
       "      <td>NaN</td>\n",
       "      <td>5.541</td>\n",
       "      <td>4.538</td>\n",
       "      <td>26.581</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>512120</th>\n",
       "      <td>医药股基</td>\n",
       "      <td>2.083</td>\n",
       "      <td>0.543</td>\n",
       "      <td>6.932</td>\n",
       "      <td>11.141</td>\n",
       "      <td>NaN</td>\n",
       "      <td>5.044</td>\n",
       "      <td>4.255</td>\n",
       "      <td>22.771</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159929</th>\n",
       "      <td>医药ETF</td>\n",
       "      <td>2.032</td>\n",
       "      <td>0.424</td>\n",
       "      <td>6.834</td>\n",
       "      <td>11.658</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.221</td>\n",
       "      <td>4.477</td>\n",
       "      <td>15.793</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159938</th>\n",
       "      <td>广发医药</td>\n",
       "      <td>2.011</td>\n",
       "      <td>-0.141</td>\n",
       "      <td>5.733</td>\n",
       "      <td>11.111</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.348</td>\n",
       "      <td>2.675</td>\n",
       "      <td>9.653</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>510280</th>\n",
       "      <td>成长ETF</td>\n",
       "      <td>1.884</td>\n",
       "      <td>1.546</td>\n",
       "      <td>1.602</td>\n",
       "      <td>3.257</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-5.304</td>\n",
       "      <td>9.204</td>\n",
       "      <td>44.269</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>512300</th>\n",
       "      <td>500医药</td>\n",
       "      <td>1.524</td>\n",
       "      <td>-1.171</td>\n",
       "      <td>4.801</td>\n",
       "      <td>11.053</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.932</td>\n",
       "      <td>2.262</td>\n",
       "      <td>2.262</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>512610</th>\n",
       "      <td>医药卫生</td>\n",
       "      <td>1.414</td>\n",
       "      <td>0.733</td>\n",
       "      <td>8.410</td>\n",
       "      <td>13.636</td>\n",
       "      <td>NaN</td>\n",
       "      <td>5.096</td>\n",
       "      <td>5.096</td>\n",
       "      <td>17.054</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>512220</th>\n",
       "      <td>景顺TMT</td>\n",
       "      <td>1.384</td>\n",
       "      <td>-1.546</td>\n",
       "      <td>3.315</td>\n",
       "      <td>14.722</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.387</td>\n",
       "      <td>0.757</td>\n",
       "      <td>9.084</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159915</th>\n",
       "      <td>创业板</td>\n",
       "      <td>1.166</td>\n",
       "      <td>-2.307</td>\n",
       "      <td>2.722</td>\n",
       "      <td>11.784</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.058</td>\n",
       "      <td>0.231</td>\n",
       "      <td>-7.066</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159952</th>\n",
       "      <td>创业ETF</td>\n",
       "      <td>1.166</td>\n",
       "      <td>-2.070</td>\n",
       "      <td>2.663</td>\n",
       "      <td>11.576</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.360</td>\n",
       "      <td>0.872</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159949</th>\n",
       "      <td>创业板50</td>\n",
       "      <td>1.136</td>\n",
       "      <td>-1.928</td>\n",
       "      <td>3.338</td>\n",
       "      <td>13.557</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.890</td>\n",
       "      <td>0.282</td>\n",
       "      <td>-11.553</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159948</th>\n",
       "      <td>创业板EF</td>\n",
       "      <td>1.112</td>\n",
       "      <td>-2.203</td>\n",
       "      <td>1.976</td>\n",
       "      <td>11.637</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.195</td>\n",
       "      <td>0.210</td>\n",
       "      <td>-4.835</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>510230</th>\n",
       "      <td>金融ETF</td>\n",
       "      <td>1.077</td>\n",
       "      <td>-0.777</td>\n",
       "      <td>1.237</td>\n",
       "      <td>2.836</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-8.026</td>\n",
       "      <td>1.237</td>\n",
       "      <td>20.639</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>510050</th>\n",
       "      <td>50ETF</td>\n",
       "      <td>1.048</td>\n",
       "      <td>-0.448</td>\n",
       "      <td>1.296</td>\n",
       "      <td>3.286</td>\n",
       "      <td>310.504</td>\n",
       "      <td>-7.129</td>\n",
       "      <td>3.326</td>\n",
       "      <td>26.161</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159955</th>\n",
       "      <td>创业板E</td>\n",
       "      <td>1.010</td>\n",
       "      <td>-2.057</td>\n",
       "      <td>2.354</td>\n",
       "      <td>11.483</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.041</td>\n",
       "      <td>-0.990</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>512330</th>\n",
       "      <td>500信息</td>\n",
       "      <td>0.973</td>\n",
       "      <td>-2.924</td>\n",
       "      <td>1.096</td>\n",
       "      <td>14.641</td>\n",
       "      <td>NaN</td>\n",
       "      <td>6.138</td>\n",
       "      <td>-2.696</td>\n",
       "      <td>-1.190</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>510420</th>\n",
       "      <td>180EWETF</td>\n",
       "      <td>0.898</td>\n",
       "      <td>-0.273</td>\n",
       "      <td>0.689</td>\n",
       "      <td>-4.945</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-6.526</td>\n",
       "      <td>-4.134</td>\n",
       "      <td>-1.016</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>510090</th>\n",
       "      <td>责任ETF</td>\n",
       "      <td>0.895</td>\n",
       "      <td>-0.471</td>\n",
       "      <td>1.197</td>\n",
       "      <td>1.257</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-6.626</td>\n",
       "      <td>1.318</td>\n",
       "      <td>27.526</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>510270</th>\n",
       "      <td>国企ETF</td>\n",
       "      <td>0.873</td>\n",
       "      <td>-1.198</td>\n",
       "      <td>0.260</td>\n",
       "      <td>-2.778</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-8.333</td>\n",
       "      <td>0.522</td>\n",
       "      <td>12.463</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159958</th>\n",
       "      <td>创业板ET</td>\n",
       "      <td>0.865</td>\n",
       "      <td>-2.146</td>\n",
       "      <td>2.341</td>\n",
       "      <td>11.241</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.043</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>161036</th>\n",
       "      <td>娱乐增强</td>\n",
       "      <td>0.809</td>\n",
       "      <td>-1.802</td>\n",
       "      <td>3.563</td>\n",
       "      <td>7.654</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-1.802</td>\n",
       "      <td>-5.628</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>513660</th>\n",
       "      <td>恒生通</td>\n",
       "      <td>0.801</td>\n",
       "      <td>-1.270</td>\n",
       "      <td>3.322</td>\n",
       "      <td>7.131</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-3.609</td>\n",
       "      <td>4.962</td>\n",
       "      <td>22.920</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>512660</th>\n",
       "      <td>军工ETF</td>\n",
       "      <td>0.754</td>\n",
       "      <td>-2.906</td>\n",
       "      <td>0.000</td>\n",
       "      <td>11.544</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-1.716</td>\n",
       "      <td>-8.656</td>\n",
       "      <td>-22.885</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>512550</th>\n",
       "      <td>富时A50</td>\n",
       "      <td>0.713</td>\n",
       "      <td>-0.616</td>\n",
       "      <td>1.345</td>\n",
       "      <td>3.385</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-6.766</td>\n",
       "      <td>4.244</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159920</th>\n",
       "      <td>恒生ETF</td>\n",
       "      <td>0.685</td>\n",
       "      <td>0.000</td>\n",
       "      <td>4.393</td>\n",
       "      <td>6.386</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-4.604</td>\n",
       "      <td>5.414</td>\n",
       "      <td>24.308</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>512810</th>\n",
       "      <td>军工行业</td>\n",
       "      <td>0.652</td>\n",
       "      <td>-2.771</td>\n",
       "      <td>0.130</td>\n",
       "      <td>10.602</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-1.781</td>\n",
       "      <td>-9.176</td>\n",
       "      <td>-21.941</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>510210</th>\n",
       "      <td>综指ETF</td>\n",
       "      <td>0.650</td>\n",
       "      <td>-1.875</td>\n",
       "      <td>0.814</td>\n",
       "      <td>0.759</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-7.332</td>\n",
       "      <td>-7.100</td>\n",
       "      <td>3.770</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>512680</th>\n",
       "      <td>军工基金</td>\n",
       "      <td>0.641</td>\n",
       "      <td>-2.605</td>\n",
       "      <td>0.128</td>\n",
       "      <td>10.876</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-1.506</td>\n",
       "      <td>-8.401</td>\n",
       "      <td>-22.507</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>510010</th>\n",
       "      <td>治理ETF</td>\n",
       "      <td>-0.169</td>\n",
       "      <td>-1.257</td>\n",
       "      <td>1.377</td>\n",
       "      <td>0.341</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-6.508</td>\n",
       "      <td>1.464</td>\n",
       "      <td>18.511</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159925</th>\n",
       "      <td>南方300</td>\n",
       "      <td>-0.176</td>\n",
       "      <td>-1.222</td>\n",
       "      <td>1.193</td>\n",
       "      <td>4.238</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-4.983</td>\n",
       "      <td>1.983</td>\n",
       "      <td>21.128</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>510150</th>\n",
       "      <td>消费ETF</td>\n",
       "      <td>-0.210</td>\n",
       "      <td>1.517</td>\n",
       "      <td>4.192</td>\n",
       "      <td>3.757</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.154</td>\n",
       "      <td>3.326</td>\n",
       "      <td>32.630</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>513100</th>\n",
       "      <td>纳指ETF</td>\n",
       "      <td>-0.214</td>\n",
       "      <td>-1.478</td>\n",
       "      <td>2.866</td>\n",
       "      <td>9.479</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.469</td>\n",
       "      <td>7.067</td>\n",
       "      <td>17.001</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159909</th>\n",
       "      <td>深TMT</td>\n",
       "      <td>-0.256</td>\n",
       "      <td>-2.482</td>\n",
       "      <td>1.506</td>\n",
       "      <td>11.837</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.336</td>\n",
       "      <td>-0.201</td>\n",
       "      <td>15.455</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>510130</th>\n",
       "      <td>中盘ETF</td>\n",
       "      <td>-0.325</td>\n",
       "      <td>-1.407</td>\n",
       "      <td>1.448</td>\n",
       "      <td>4.501</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-4.565</td>\n",
       "      <td>-1.407</td>\n",
       "      <td>8.417</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159934</th>\n",
       "      <td>黄金ETF</td>\n",
       "      <td>-0.336</td>\n",
       "      <td>-0.782</td>\n",
       "      <td>-1.186</td>\n",
       "      <td>-0.522</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-2.665</td>\n",
       "      <td>-1.949</td>\n",
       "      <td>-0.818</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159901</th>\n",
       "      <td>深100ETF</td>\n",
       "      <td>-0.357</td>\n",
       "      <td>-2.274</td>\n",
       "      <td>1.802</td>\n",
       "      <td>6.010</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-4.156</td>\n",
       "      <td>0.741</td>\n",
       "      <td>22.015</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159930</th>\n",
       "      <td>能源ETF</td>\n",
       "      <td>-0.359</td>\n",
       "      <td>-1.070</td>\n",
       "      <td>-0.952</td>\n",
       "      <td>-3.143</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-10.730</td>\n",
       "      <td>0.848</td>\n",
       "      <td>-1.771</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>518880</th>\n",
       "      <td>黄金ETF</td>\n",
       "      <td>-0.372</td>\n",
       "      <td>-0.778</td>\n",
       "      <td>-1.181</td>\n",
       "      <td>-0.594</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-2.760</td>\n",
       "      <td>-1.290</td>\n",
       "      <td>-0.446</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159922</th>\n",
       "      <td>500ETF</td>\n",
       "      <td>-0.380</td>\n",
       "      <td>-2.448</td>\n",
       "      <td>1.157</td>\n",
       "      <td>7.515</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-2.599</td>\n",
       "      <td>-4.476</td>\n",
       "      <td>-3.005</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>510440</th>\n",
       "      <td>500沪市</td>\n",
       "      <td>-0.398</td>\n",
       "      <td>-2.013</td>\n",
       "      <td>-1.129</td>\n",
       "      <td>3.059</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-8.702</td>\n",
       "      <td>-6.560</td>\n",
       "      <td>-4.731</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159937</th>\n",
       "      <td>博时黄金</td>\n",
       "      <td>-0.409</td>\n",
       "      <td>-0.888</td>\n",
       "      <td>-1.217</td>\n",
       "      <td>-0.667</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-2.759</td>\n",
       "      <td>-2.012</td>\n",
       "      <td>-0.851</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159942</th>\n",
       "      <td>中创100</td>\n",
       "      <td>-0.410</td>\n",
       "      <td>-2.653</td>\n",
       "      <td>-1.668</td>\n",
       "      <td>6.168</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.816</td>\n",
       "      <td>-2.944</td>\n",
       "      <td>4.626</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>518800</th>\n",
       "      <td>黄金基金</td>\n",
       "      <td>-0.412</td>\n",
       "      <td>-0.709</td>\n",
       "      <td>-1.152</td>\n",
       "      <td>-0.524</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-2.707</td>\n",
       "      <td>-1.990</td>\n",
       "      <td>-1.042</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159941</th>\n",
       "      <td>纳指100</td>\n",
       "      <td>-0.475</td>\n",
       "      <td>-0.678</td>\n",
       "      <td>3.239</td>\n",
       "      <td>10.725</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.812</td>\n",
       "      <td>7.242</td>\n",
       "      <td>13.292</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>510880</th>\n",
       "      <td>红利ETF</td>\n",
       "      <td>-0.492</td>\n",
       "      <td>-1.876</td>\n",
       "      <td>-0.525</td>\n",
       "      <td>1.676</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-6.904</td>\n",
       "      <td>2.465</td>\n",
       "      <td>16.540</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>510410</th>\n",
       "      <td>资源ETF</td>\n",
       "      <td>-0.504</td>\n",
       "      <td>-1.988</td>\n",
       "      <td>0.766</td>\n",
       "      <td>2.468</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-9.725</td>\n",
       "      <td>-0.630</td>\n",
       "      <td>12.233</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159945</th>\n",
       "      <td>全指能源</td>\n",
       "      <td>-0.533</td>\n",
       "      <td>-2.228</td>\n",
       "      <td>-0.666</td>\n",
       "      <td>-1.842</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-11.401</td>\n",
       "      <td>-1.583</td>\n",
       "      <td>3.900</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159916</th>\n",
       "      <td>深F60</td>\n",
       "      <td>-0.560</td>\n",
       "      <td>-1.414</td>\n",
       "      <td>1.693</td>\n",
       "      <td>3.692</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-7.510</td>\n",
       "      <td>1.959</td>\n",
       "      <td>39.031</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159910</th>\n",
       "      <td>深F120</td>\n",
       "      <td>-0.591</td>\n",
       "      <td>-2.375</td>\n",
       "      <td>1.093</td>\n",
       "      <td>3.991</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-8.234</td>\n",
       "      <td>5.654</td>\n",
       "      <td>30.465</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>512570</th>\n",
       "      <td>中证证券</td>\n",
       "      <td>-0.690</td>\n",
       "      <td>-2.925</td>\n",
       "      <td>1.172</td>\n",
       "      <td>2.738</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-14.129</td>\n",
       "      <td>-12.297</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>510160</th>\n",
       "      <td>小康ETF</td>\n",
       "      <td>-0.826</td>\n",
       "      <td>-2.280</td>\n",
       "      <td>-0.498</td>\n",
       "      <td>0.000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-9.228</td>\n",
       "      <td>-3.226</td>\n",
       "      <td>7.143</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159944</th>\n",
       "      <td>全指材料</td>\n",
       "      <td>-0.958</td>\n",
       "      <td>-1.587</td>\n",
       "      <td>1.087</td>\n",
       "      <td>3.219</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-5.775</td>\n",
       "      <td>-3.627</td>\n",
       "      <td>2.423</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159950</th>\n",
       "      <td>深成指EF</td>\n",
       "      <td>-1.036</td>\n",
       "      <td>-2.881</td>\n",
       "      <td>3.243</td>\n",
       "      <td>10.725</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.087</td>\n",
       "      <td>2.321</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>510430</th>\n",
       "      <td>50等权</td>\n",
       "      <td>-1.112</td>\n",
       "      <td>-1.818</td>\n",
       "      <td>-0.592</td>\n",
       "      <td>-2.890</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-8.141</td>\n",
       "      <td>1.070</td>\n",
       "      <td>12.500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>512340</th>\n",
       "      <td>500原料</td>\n",
       "      <td>-1.244</td>\n",
       "      <td>-2.953</td>\n",
       "      <td>0.847</td>\n",
       "      <td>5.537</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-4.985</td>\n",
       "      <td>1.816</td>\n",
       "      <td>9.666</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>512600</th>\n",
       "      <td>主要消费</td>\n",
       "      <td>-1.414</td>\n",
       "      <td>-0.347</td>\n",
       "      <td>0.833</td>\n",
       "      <td>0.218</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-8.730</td>\n",
       "      <td>2.816</td>\n",
       "      <td>43.213</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>510120</th>\n",
       "      <td>非周ETF</td>\n",
       "      <td>-1.793</td>\n",
       "      <td>-0.888</td>\n",
       "      <td>1.142</td>\n",
       "      <td>0.568</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-4.015</td>\n",
       "      <td>-1.601</td>\n",
       "      <td>12.809</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159908</th>\n",
       "      <td>深F200</td>\n",
       "      <td>-6.313</td>\n",
       "      <td>-0.757</td>\n",
       "      <td>-0.317</td>\n",
       "      <td>8.934</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-12.805</td>\n",
       "      <td>5.147</td>\n",
       "      <td>21.749</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>131 rows × 9 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "              指数     1日     5日    10日     20日     年初至今     30日     90日    250日\n",
       "512010     医药ETF  2.733  2.792  9.400  14.105      NaN   7.381   9.400  35.629\n",
       "512070     非银ETF  2.321 -0.197  4.107   7.758      NaN  -7.058  -2.265  20.642\n",
       "510660      医药行业  2.113  0.763  7.430  13.006      NaN   5.541   4.538  26.581\n",
       "512120      医药股基  2.083  0.543  6.932  11.141      NaN   5.044   4.255  22.771\n",
       "159929     医药ETF  2.032  0.424  6.834  11.658      NaN   2.221   4.477  15.793\n",
       "159938      广发医药  2.011 -0.141  5.733  11.111      NaN   3.348   2.675   9.653\n",
       "510280     成长ETF  1.884  1.546  1.602   3.257      NaN  -5.304   9.204  44.269\n",
       "512300     500医药  1.524 -1.171  4.801  11.053      NaN   1.932   2.262   2.262\n",
       "512610      医药卫生  1.414  0.733  8.410  13.636      NaN   5.096   5.096  17.054\n",
       "512220     景顺TMT  1.384 -1.546  3.315  14.722      NaN   3.387   0.757   9.084\n",
       "159915       创业板  1.166 -2.307  2.722  11.784      NaN   2.058   0.231  -7.066\n",
       "159952     创业ETF  1.166 -2.070  2.663  11.576      NaN   2.360   0.872     NaN\n",
       "159949     创业板50  1.136 -1.928  3.338  13.557      NaN   2.890   0.282 -11.553\n",
       "159948     创业板EF  1.112 -2.203  1.976  11.637      NaN   2.195   0.210  -4.835\n",
       "510230     金融ETF  1.077 -0.777  1.237   2.836      NaN  -8.026   1.237  20.639\n",
       "510050     50ETF  1.048 -0.448  1.296   3.286  310.504  -7.129   3.326  26.161\n",
       "159955      创业板E  1.010 -2.057  2.354  11.483      NaN   2.041  -0.990     NaN\n",
       "512330     500信息  0.973 -2.924  1.096  14.641      NaN   6.138  -2.696  -1.190\n",
       "510420  180EWETF  0.898 -0.273  0.689  -4.945      NaN  -6.526  -4.134  -1.016\n",
       "510090     责任ETF  0.895 -0.471  1.197   1.257      NaN  -6.626   1.318  27.526\n",
       "510270     国企ETF  0.873 -1.198  0.260  -2.778      NaN  -8.333   0.522  12.463\n",
       "159958     创业板ET  0.865 -2.146  2.341  11.241      NaN   2.043     NaN     NaN\n",
       "161036      娱乐增强  0.809 -1.802  3.563   7.654      NaN  -1.802  -5.628     NaN\n",
       "513660       恒生通  0.801 -1.270  3.322   7.131      NaN  -3.609   4.962  22.920\n",
       "512660     军工ETF  0.754 -2.906  0.000  11.544      NaN  -1.716  -8.656 -22.885\n",
       "512550     富时A50  0.713 -0.616  1.345   3.385      NaN  -6.766   4.244     NaN\n",
       "159920     恒生ETF  0.685  0.000  4.393   6.386      NaN  -4.604   5.414  24.308\n",
       "512810      军工行业  0.652 -2.771  0.130  10.602      NaN  -1.781  -9.176 -21.941\n",
       "510210     综指ETF  0.650 -1.875  0.814   0.759      NaN  -7.332  -7.100   3.770\n",
       "512680      军工基金  0.641 -2.605  0.128  10.876      NaN  -1.506  -8.401 -22.507\n",
       "...          ...    ...    ...    ...     ...      ...     ...     ...     ...\n",
       "510010     治理ETF -0.169 -1.257  1.377   0.341      NaN  -6.508   1.464  18.511\n",
       "159925     南方300 -0.176 -1.222  1.193   4.238      NaN  -4.983   1.983  21.128\n",
       "510150     消费ETF -0.210  1.517  4.192   3.757      NaN   0.154   3.326  32.630\n",
       "513100     纳指ETF -0.214 -1.478  2.866   9.479      NaN  -0.469   7.067  17.001\n",
       "159909      深TMT -0.256 -2.482  1.506  11.837      NaN   1.336  -0.201  15.455\n",
       "510130     中盘ETF -0.325 -1.407  1.448   4.501      NaN  -4.565  -1.407   8.417\n",
       "159934     黄金ETF -0.336 -0.782 -1.186  -0.522      NaN  -2.665  -1.949  -0.818\n",
       "159901   深100ETF -0.357 -2.274  1.802   6.010      NaN  -4.156   0.741  22.015\n",
       "159930     能源ETF -0.359 -1.070 -0.952  -3.143      NaN -10.730   0.848  -1.771\n",
       "518880     黄金ETF -0.372 -0.778 -1.181  -0.594      NaN  -2.760  -1.290  -0.446\n",
       "159922    500ETF -0.380 -2.448  1.157   7.515      NaN  -2.599  -4.476  -3.005\n",
       "510440     500沪市 -0.398 -2.013 -1.129   3.059      NaN  -8.702  -6.560  -4.731\n",
       "159937      博时黄金 -0.409 -0.888 -1.217  -0.667      NaN  -2.759  -2.012  -0.851\n",
       "159942     中创100 -0.410 -2.653 -1.668   6.168      NaN  -0.816  -2.944   4.626\n",
       "518800      黄金基金 -0.412 -0.709 -1.152  -0.524      NaN  -2.707  -1.990  -1.042\n",
       "159941     纳指100 -0.475 -0.678  3.239  10.725      NaN  -0.812   7.242  13.292\n",
       "510880     红利ETF -0.492 -1.876 -0.525   1.676      NaN  -6.904   2.465  16.540\n",
       "510410     资源ETF -0.504 -1.988  0.766   2.468      NaN  -9.725  -0.630  12.233\n",
       "159945      全指能源 -0.533 -2.228 -0.666  -1.842      NaN -11.401  -1.583   3.900\n",
       "159916      深F60 -0.560 -1.414  1.693   3.692      NaN  -7.510   1.959  39.031\n",
       "159910     深F120 -0.591 -2.375  1.093   3.991      NaN  -8.234   5.654  30.465\n",
       "512570      中证证券 -0.690 -2.925  1.172   2.738      NaN -14.129 -12.297     NaN\n",
       "510160     小康ETF -0.826 -2.280 -0.498   0.000      NaN  -9.228  -3.226   7.143\n",
       "159944      全指材料 -0.958 -1.587  1.087   3.219      NaN  -5.775  -3.627   2.423\n",
       "159950     深成指EF -1.036 -2.881  3.243  10.725      NaN   0.087   2.321     NaN\n",
       "510430      50等权 -1.112 -1.818 -0.592  -2.890      NaN  -8.141   1.070  12.500\n",
       "512340     500原料 -1.244 -2.953  0.847   5.537      NaN  -4.985   1.816   9.666\n",
       "512600      主要消费 -1.414 -0.347  0.833   0.218      NaN  -8.730   2.816  43.213\n",
       "510120     非周ETF -1.793 -0.888  1.142   0.568      NaN  -4.015  -1.601  12.809\n",
       "159908     深F200 -6.313 -0.757 -0.317   8.934      NaN -12.805   5.147  21.749\n",
       "\n",
       "[131 rows x 9 columns]"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "print( '昨日涨幅：')\n",
    "df=fund_market_analysis(fund_all_list) \n",
    "df=df.sort(['1日'],ascending=False)\n",
    "df#[0:10]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 2.2.近5日涨幅前20"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "近5日涨幅：\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>指数</th>\n",
       "      <th>1日涨幅</th>\n",
       "      <th>5日涨幅</th>\n",
       "      <th>10日涨幅</th>\n",
       "      <th>20日涨幅</th>\n",
       "      <th>年初至今涨幅</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>159908</th>\n",
       "      <td>深F200</td>\n",
       "      <td>-2.270</td>\n",
       "      <td>7.697</td>\n",
       "      <td>6.468</td>\n",
       "      <td>12.158</td>\n",
       "      <td>12.308</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>510120</th>\n",
       "      <td>非周ETF</td>\n",
       "      <td>2.165</td>\n",
       "      <td>3.231</td>\n",
       "      <td>3.685</td>\n",
       "      <td>-4.006</td>\n",
       "      <td>0.360</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159953</th>\n",
       "      <td>工业ETF</td>\n",
       "      <td>0.110</td>\n",
       "      <td>2.599</td>\n",
       "      <td>2.948</td>\n",
       "      <td>8.353</td>\n",
       "      <td>-5.021</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>510170</th>\n",
       "      <td>商品ETF</td>\n",
       "      <td>0.000</td>\n",
       "      <td>2.422</td>\n",
       "      <td>0.845</td>\n",
       "      <td>6.394</td>\n",
       "      <td>0.296</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>513050</th>\n",
       "      <td>中概互联</td>\n",
       "      <td>1.259</td>\n",
       "      <td>2.354</td>\n",
       "      <td>5.508</td>\n",
       "      <td>16.763</td>\n",
       "      <td>7.625</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159941</th>\n",
       "      <td>纳指100</td>\n",
       "      <td>0.546</td>\n",
       "      <td>2.079</td>\n",
       "      <td>3.952</td>\n",
       "      <td>15.439</td>\n",
       "      <td>6.277</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>512600</th>\n",
       "      <td>主要消费</td>\n",
       "      <td>0.086</td>\n",
       "      <td>1.878</td>\n",
       "      <td>1.435</td>\n",
       "      <td>4.432</td>\n",
       "      <td>-1.144</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>510150</th>\n",
       "      <td>消费ETF</td>\n",
       "      <td>0.326</td>\n",
       "      <td>1.751</td>\n",
       "      <td>5.041</td>\n",
       "      <td>2.168</td>\n",
       "      <td>3.380</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159935</th>\n",
       "      <td>景顺500</td>\n",
       "      <td>0.000</td>\n",
       "      <td>1.720</td>\n",
       "      <td>3.824</td>\n",
       "      <td>4.810</td>\n",
       "      <td>-0.481</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159911</th>\n",
       "      <td>民营ETF</td>\n",
       "      <td>0.566</td>\n",
       "      <td>1.369</td>\n",
       "      <td>2.776</td>\n",
       "      <td>11.861</td>\n",
       "      <td>-1.508</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>513600</th>\n",
       "      <td>恒指ETF</td>\n",
       "      <td>0.076</td>\n",
       "      <td>1.264</td>\n",
       "      <td>2.640</td>\n",
       "      <td>7.830</td>\n",
       "      <td>1.928</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159944</th>\n",
       "      <td>全指材料</td>\n",
       "      <td>-1.158</td>\n",
       "      <td>1.185</td>\n",
       "      <td>2.735</td>\n",
       "      <td>6.826</td>\n",
       "      <td>-1.054</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>510260</th>\n",
       "      <td>新兴ETF</td>\n",
       "      <td>-0.745</td>\n",
       "      <td>1.181</td>\n",
       "      <td>3.720</td>\n",
       "      <td>7.149</td>\n",
       "      <td>-0.498</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159936</th>\n",
       "      <td>可选消费</td>\n",
       "      <td>-0.371</td>\n",
       "      <td>1.066</td>\n",
       "      <td>3.935</td>\n",
       "      <td>4.883</td>\n",
       "      <td>2.156</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>510900</th>\n",
       "      <td>H股ETF</td>\n",
       "      <td>-0.693</td>\n",
       "      <td>1.019</td>\n",
       "      <td>2.383</td>\n",
       "      <td>5.224</td>\n",
       "      <td>4.372</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159920</th>\n",
       "      <td>恒生ETF</td>\n",
       "      <td>-0.187</td>\n",
       "      <td>0.943</td>\n",
       "      <td>2.164</td>\n",
       "      <td>6.221</td>\n",
       "      <td>1.840</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159926</th>\n",
       "      <td>国债ETF</td>\n",
       "      <td>0.906</td>\n",
       "      <td>0.935</td>\n",
       "      <td>0.289</td>\n",
       "      <td>-0.249</td>\n",
       "      <td>2.857</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>513100</th>\n",
       "      <td>纳指ETF</td>\n",
       "      <td>0.043</td>\n",
       "      <td>0.819</td>\n",
       "      <td>3.773</td>\n",
       "      <td>11.759</td>\n",
       "      <td>4.890</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159918</th>\n",
       "      <td>中创400</td>\n",
       "      <td>-0.748</td>\n",
       "      <td>0.818</td>\n",
       "      <td>2.009</td>\n",
       "      <td>9.379</td>\n",
       "      <td>0.174</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159906</th>\n",
       "      <td>深成长</td>\n",
       "      <td>-0.652</td>\n",
       "      <td>0.755</td>\n",
       "      <td>2.203</td>\n",
       "      <td>12.672</td>\n",
       "      <td>4.916</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "           指数   1日涨幅   5日涨幅  10日涨幅   20日涨幅  年初至今涨幅\n",
       "159908  深F200 -2.270  7.697  6.468  12.158  12.308\n",
       "510120  非周ETF  2.165  3.231  3.685  -4.006   0.360\n",
       "159953  工业ETF  0.110  2.599  2.948   8.353  -5.021\n",
       "510170  商品ETF  0.000  2.422  0.845   6.394   0.296\n",
       "513050   中概互联  1.259  2.354  5.508  16.763   7.625\n",
       "159941  纳指100  0.546  2.079  3.952  15.439   6.277\n",
       "512600   主要消费  0.086  1.878  1.435   4.432  -1.144\n",
       "510150  消费ETF  0.326  1.751  5.041   2.168   3.380\n",
       "159935  景顺500  0.000  1.720  3.824   4.810  -0.481\n",
       "159911  民营ETF  0.566  1.369  2.776  11.861  -1.508\n",
       "513600  恒指ETF  0.076  1.264  2.640   7.830   1.928\n",
       "159944   全指材料 -1.158  1.185  2.735   6.826  -1.054\n",
       "510260  新兴ETF -0.745  1.181  3.720   7.149  -0.498\n",
       "159936   可选消费 -0.371  1.066  3.935   4.883   2.156\n",
       "510900  H股ETF -0.693  1.019  2.383   5.224   4.372\n",
       "159920  恒生ETF -0.187  0.943  2.164   6.221   1.840\n",
       "159926  国债ETF  0.906  0.935  0.289  -0.249   2.857\n",
       "513100  纳指ETF  0.043  0.819  3.773  11.759   4.890\n",
       "159918  中创400 -0.748  0.818  2.009   9.379   0.174\n",
       "159906    深成长 -0.652  0.755  2.203  12.672   4.916"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "print( '近5日涨幅：')\n",
    "df=fund_market_analysis(fund_all_list) \n",
    "df=df.sort(['5日涨幅'],ascending=False)\n",
    "df[0:20]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 2.3.年初至今涨幅前30"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "年初至今涨幅：\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>指数</th>\n",
       "      <th>1日涨幅</th>\n",
       "      <th>5日涨幅</th>\n",
       "      <th>10日涨幅</th>\n",
       "      <th>20日涨幅</th>\n",
       "      <th>年初至今涨幅</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>159908</th>\n",
       "      <td>深F200</td>\n",
       "      <td>-2.270</td>\n",
       "      <td>7.697</td>\n",
       "      <td>6.468</td>\n",
       "      <td>12.158</td>\n",
       "      <td>12.308</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>513050</th>\n",
       "      <td>中概互联</td>\n",
       "      <td>1.259</td>\n",
       "      <td>2.354</td>\n",
       "      <td>5.508</td>\n",
       "      <td>16.763</td>\n",
       "      <td>7.625</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>512010</th>\n",
       "      <td>医药ETF</td>\n",
       "      <td>-0.057</td>\n",
       "      <td>-0.114</td>\n",
       "      <td>7.269</td>\n",
       "      <td>14.921</td>\n",
       "      <td>6.489</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159941</th>\n",
       "      <td>纳指100</td>\n",
       "      <td>0.546</td>\n",
       "      <td>2.079</td>\n",
       "      <td>3.952</td>\n",
       "      <td>15.439</td>\n",
       "      <td>6.277</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159949</th>\n",
       "      <td>创业板50</td>\n",
       "      <td>-1.676</td>\n",
       "      <td>-1.401</td>\n",
       "      <td>3.988</td>\n",
       "      <td>16.172</td>\n",
       "      <td>5.075</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159906</th>\n",
       "      <td>深成长</td>\n",
       "      <td>-0.652</td>\n",
       "      <td>0.755</td>\n",
       "      <td>2.203</td>\n",
       "      <td>12.672</td>\n",
       "      <td>4.916</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>513100</th>\n",
       "      <td>纳指ETF</td>\n",
       "      <td>0.043</td>\n",
       "      <td>0.819</td>\n",
       "      <td>3.773</td>\n",
       "      <td>11.759</td>\n",
       "      <td>4.890</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159915</th>\n",
       "      <td>创业板</td>\n",
       "      <td>-1.493</td>\n",
       "      <td>-2.222</td>\n",
       "      <td>2.816</td>\n",
       "      <td>14.248</td>\n",
       "      <td>4.380</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>510900</th>\n",
       "      <td>H股ETF</td>\n",
       "      <td>-0.693</td>\n",
       "      <td>1.019</td>\n",
       "      <td>2.383</td>\n",
       "      <td>5.224</td>\n",
       "      <td>4.372</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159948</th>\n",
       "      <td>创业板EF</td>\n",
       "      <td>-1.461</td>\n",
       "      <td>-2.024</td>\n",
       "      <td>2.442</td>\n",
       "      <td>14.424</td>\n",
       "      <td>4.367</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>512610</th>\n",
       "      <td>医药卫生</td>\n",
       "      <td>0.246</td>\n",
       "      <td>0.062</td>\n",
       "      <td>6.132</td>\n",
       "      <td>14.901</td>\n",
       "      <td>4.295</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159952</th>\n",
       "      <td>创业ETF</td>\n",
       "      <td>-1.437</td>\n",
       "      <td>-2.000</td>\n",
       "      <td>2.797</td>\n",
       "      <td>14.206</td>\n",
       "      <td>4.044</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159950</th>\n",
       "      <td>深成指EF</td>\n",
       "      <td>2.478</td>\n",
       "      <td>-1.864</td>\n",
       "      <td>5.657</td>\n",
       "      <td>15.569</td>\n",
       "      <td>3.857</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159955</th>\n",
       "      <td>创业板E</td>\n",
       "      <td>-1.198</td>\n",
       "      <td>-1.980</td>\n",
       "      <td>2.697</td>\n",
       "      <td>13.924</td>\n",
       "      <td>3.774</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159910</th>\n",
       "      <td>深F120</td>\n",
       "      <td>-0.747</td>\n",
       "      <td>-1.482</td>\n",
       "      <td>1.031</td>\n",
       "      <td>7.324</td>\n",
       "      <td>3.677</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>161036</th>\n",
       "      <td>娱乐增强</td>\n",
       "      <td>0.348</td>\n",
       "      <td>-1.143</td>\n",
       "      <td>1.645</td>\n",
       "      <td>10.191</td>\n",
       "      <td>3.469</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>510150</th>\n",
       "      <td>消费ETF</td>\n",
       "      <td>0.326</td>\n",
       "      <td>1.751</td>\n",
       "      <td>5.041</td>\n",
       "      <td>2.168</td>\n",
       "      <td>3.380</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>510280</th>\n",
       "      <td>成长ETF</td>\n",
       "      <td>-0.055</td>\n",
       "      <td>-0.331</td>\n",
       "      <td>-0.111</td>\n",
       "      <td>-3.785</td>\n",
       "      <td>3.261</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159926</th>\n",
       "      <td>国债ETF</td>\n",
       "      <td>0.906</td>\n",
       "      <td>0.935</td>\n",
       "      <td>0.289</td>\n",
       "      <td>-0.249</td>\n",
       "      <td>2.857</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>510660</th>\n",
       "      <td>医药行业</td>\n",
       "      <td>-0.103</td>\n",
       "      <td>-0.564</td>\n",
       "      <td>5.492</td>\n",
       "      <td>14.118</td>\n",
       "      <td>2.646</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159913</th>\n",
       "      <td>深价值</td>\n",
       "      <td>-0.106</td>\n",
       "      <td>-0.474</td>\n",
       "      <td>-1.919</td>\n",
       "      <td>0.800</td>\n",
       "      <td>2.549</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>512700</th>\n",
       "      <td>银行基金</td>\n",
       "      <td>-0.936</td>\n",
       "      <td>-2.037</td>\n",
       "      <td>-1.398</td>\n",
       "      <td>-1.946</td>\n",
       "      <td>2.519</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159939</th>\n",
       "      <td>信息技术</td>\n",
       "      <td>-1.150</td>\n",
       "      <td>-1.238</td>\n",
       "      <td>3.235</td>\n",
       "      <td>16.719</td>\n",
       "      <td>2.477</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>510030</th>\n",
       "      <td>价值ETF</td>\n",
       "      <td>-0.307</td>\n",
       "      <td>-1.047</td>\n",
       "      <td>-4.901</td>\n",
       "      <td>-1.478</td>\n",
       "      <td>2.221</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>512120</th>\n",
       "      <td>医药股基</td>\n",
       "      <td>-0.061</td>\n",
       "      <td>-0.790</td>\n",
       "      <td>5.358</td>\n",
       "      <td>12.552</td>\n",
       "      <td>2.192</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159936</th>\n",
       "      <td>可选消费</td>\n",
       "      <td>-0.371</td>\n",
       "      <td>1.066</td>\n",
       "      <td>3.935</td>\n",
       "      <td>4.883</td>\n",
       "      <td>2.156</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>511220</th>\n",
       "      <td>城投ETF</td>\n",
       "      <td>-0.018</td>\n",
       "      <td>0.061</td>\n",
       "      <td>0.234</td>\n",
       "      <td>1.149</td>\n",
       "      <td>2.131</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>512340</th>\n",
       "      <td>500原料</td>\n",
       "      <td>-0.618</td>\n",
       "      <td>0.312</td>\n",
       "      <td>-0.104</td>\n",
       "      <td>10.286</td>\n",
       "      <td>2.116</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159929</th>\n",
       "      <td>医药ETF</td>\n",
       "      <td>-0.612</td>\n",
       "      <td>-0.612</td>\n",
       "      <td>5.318</td>\n",
       "      <td>10.102</td>\n",
       "      <td>2.074</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>510190</th>\n",
       "      <td>龙头ETF</td>\n",
       "      <td>-0.453</td>\n",
       "      <td>-0.664</td>\n",
       "      <td>1.356</td>\n",
       "      <td>6.465</td>\n",
       "      <td>2.020</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "           指数   1日涨幅   5日涨幅  10日涨幅   20日涨幅  年初至今涨幅\n",
       "159908  深F200 -2.270  7.697  6.468  12.158  12.308\n",
       "513050   中概互联  1.259  2.354  5.508  16.763   7.625\n",
       "512010  医药ETF -0.057 -0.114  7.269  14.921   6.489\n",
       "159941  纳指100  0.546  2.079  3.952  15.439   6.277\n",
       "159949  创业板50 -1.676 -1.401  3.988  16.172   5.075\n",
       "159906    深成长 -0.652  0.755  2.203  12.672   4.916\n",
       "513100  纳指ETF  0.043  0.819  3.773  11.759   4.890\n",
       "159915    创业板 -1.493 -2.222  2.816  14.248   4.380\n",
       "510900  H股ETF -0.693  1.019  2.383   5.224   4.372\n",
       "159948  创业板EF -1.461 -2.024  2.442  14.424   4.367\n",
       "512610   医药卫生  0.246  0.062  6.132  14.901   4.295\n",
       "159952  创业ETF -1.437 -2.000  2.797  14.206   4.044\n",
       "159950  深成指EF  2.478 -1.864  5.657  15.569   3.857\n",
       "159955   创业板E -1.198 -1.980  2.697  13.924   3.774\n",
       "159910  深F120 -0.747 -1.482  1.031   7.324   3.677\n",
       "161036   娱乐增强  0.348 -1.143  1.645  10.191   3.469\n",
       "510150  消费ETF  0.326  1.751  5.041   2.168   3.380\n",
       "510280  成长ETF -0.055 -0.331 -0.111  -3.785   3.261\n",
       "159926  国债ETF  0.906  0.935  0.289  -0.249   2.857\n",
       "510660   医药行业 -0.103 -0.564  5.492  14.118   2.646\n",
       "159913    深价值 -0.106 -0.474 -1.919   0.800   2.549\n",
       "512700   银行基金 -0.936 -2.037 -1.398  -1.946   2.519\n",
       "159939   信息技术 -1.150 -1.238  3.235  16.719   2.477\n",
       "510030  价值ETF -0.307 -1.047 -4.901  -1.478   2.221\n",
       "512120   医药股基 -0.061 -0.790  5.358  12.552   2.192\n",
       "159936   可选消费 -0.371  1.066  3.935   4.883   2.156\n",
       "511220  城投ETF -0.018  0.061  0.234   1.149   2.131\n",
       "512340  500原料 -0.618  0.312 -0.104  10.286   2.116\n",
       "159929  医药ETF -0.612 -0.612  5.318  10.102   2.074\n",
       "510190  龙头ETF -0.453 -0.664  1.356   6.465   2.020"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "print( '年初至今涨幅：')\n",
    "df=fund_market_analysis(fund_all_list) \n",
    "df=df.sort(['年初至今涨幅'],ascending=False)\n",
    "df[0:30]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
